package com.stox.shared.util;

public class MathUtil {

	public static double x(final double x1, final double y1, final double x2, final double y2, final double y) {
		return x1 - (((x2 - x1) * (y1 - y)) / (y2 - y1));
	}

	public static double y(final double x1, final double y1, final double x2, final double y2, final double x) {
		return y1 - (((y2 - y1) * (x1 - x)) / (x2 - x1));
	}

	public static double praportion(final double mina, final double a, final double maxa, final double minb, final double maxb) {
		return minb + (((a - mina) * (maxb - minb)) / (maxa - mina));
	}


}
